package cn.edu.ctbu.myfirstweb.service;

import cn.edu.ctbu.myfirstweb.domain.Course;
import cn.edu.ctbu.myfirstweb.domain.Student;
import cn.edu.ctbu.myfirstweb.domain.Teacher;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface TeacherService {

    Page<Teacher> findAll(Example<Teacher> teacherExample, Pageable pageable);

    Page<Teacher> findAll(Pageable pageable);

    void deleteByTid(long tid);

    /**
     * 获取所有的教师数据
     *
     * @return
     */
    List<Teacher> findAll();

    /**
     * 添加教师
     *
     * @param teacher
     * @return
     */
    Teacher insert(Teacher teacher);

    /**
     * 更新教师信息
     *
     * @param teacher
     * @return
     */
    Teacher update(Teacher teacher);

    /**
     * 通过id查找教师
     *
     * @param id
     * @return
     */
    Teacher query(Long id);

    /**
     * 登录验证，通过教师id和password
     *
     * @param tid
     * @param password
     * @return
     */
    Teacher queryByTidAndPassword(Long tid, String password);

    /**
     * 通过教师工号查询其所授课程
     *
     * @param tid
     * @return
     */
    List<Course> getCourseByTid(Long tid);


}
